<template>
  <div class="app-container">
    <el-row :gutter="20">
      <!--用户数据-->
      <el-col :span="24" :xs="24">
        <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
          <el-form-item label="完税省份" prop="provinceCode">
            <el-select v-model="queryParams.provinceCode" placeholder="全部" clearable size="medium">
              <el-option
                v-for="dict in provinceOptions"
                :key="dict.provinceCode"
                :label="dict.provinceFullName"
                :value="dict.provinceCode"
              />
            </el-select>
          </el-form-item>
         <!-- <el-form-item label="身份" prop="taxIdentity">
            <el-select
              v-model="queryParams.taxIdentity"
              placeholder="全部"
              clearable
              size="small"
            >
              <el-option label="个体" value="0"></el-option>
              <el-option label="临登" value="1"></el-option>
              <el-option label="其他" value="88"></el-option>
            </el-select>
          </el-form-item> -->
          <el-form-item>
            <el-button type="primary" icon="el-icon-search" size="medium" @click="handleQuery">搜索</el-button>
            <el-button icon="el-icon-refresh" size="medium" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>

        <el-table v-loading="loading" :data="invoiceImportListDetail">
          <el-table-column fixed label="序号" prop="" width="55" align="center">
            <template slot-scope="scope">
              <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
            </template>
          </el-table-column>
          <el-table-column label="姓名" align="left" key="createByName" prop="createByName"/>
          <el-table-column label="证件号" align="left" key="idNumber" prop="idNumber" width="200"/>
          <!-- <el-table-column label="手机号" align="left" key="createTime" prop="createTime" /> -->
          <el-table-column label="个体户名称" align="left" key="importPersonName" prop="importPersonName" width="350"/>
          <el-table-column label="统一社会信用代码" align="left" key="importTaxNo" prop="importTaxNo" width="200"/>
          <el-table-column label="应开金额" align="left" key="totalMoney" prop="totalMoney" />
          <el-table-column label="实开金额" align="left" key="actualMoney" prop="actualMoney" />
          <el-table-column label="开票状态" align="left" key="invoiceStatus.name" prop="invoiceStatus.name" />
          <!-- <el-table-column label="开票省份" align="left" key="errorMsg" prop="errorMsg" /> -->
          <el-table-column label="管理企业" align="left" key="importCompanyAdmin" prop="importCompanyAdmin" />
          <el-table-column label="提示信息" align="left" key="errorMsg" prop="errorMsg" />
        </el-table>

        <pagination
          v-show="total>0"
          :total="total"
          :page.sync="queryParams.pageNum"
          :limit.sync="queryParams.pageSize"
          @pagination="getList"
        />
      </el-col>
    </el-row>
  </div>
</template>

<script>
import { invoiceImportListDetail } from "@/api/taxmsg/importHistoryDetails";
export default {
  name: "ImportHistoryDetails",
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 省份信息数据字典
      provinceOptions: [],
      // 用户表格数据
      invoiceImportListDetail: null,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        importBatchId: this.$route.params && this.$route.params.id
      },
      // 编辑状态表单校验
      rules: {
        declareStatus: [
          { required: true, message: "请选择申报状态", trigger: "blur" }
        ]
      }
     
    };
  },
  created() {
    this.getList();
    this.getProvince().then(response => {
      this.provinceOptions = response.data;
    });
  },
  methods: {
    /** 查询用户列表 */
    getList() {
      this.loading = true;
      invoiceImportListDetail(this.queryParams).then(response => {
          this.invoiceImportListDetail = response.data.list;
          this.total = response.data.total;
          this.loading = false;
        }
      );
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.page = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      //this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    }
  
  }
};
</script>
<style scoped lang="scss">
</style>